package com.lie.prepare.multi_thread.join;

/**
 * Created by lie on 2018/4/9.
 */
public class JoinTest {

    public static void main(String[] args){
        Sleeper sleeper = new Sleeper("sleeper", 1500);
        Sleeper grumpy = new Sleeper("grumpy", 1500);

        Joiner tom = new Joiner("tom", sleeper);
        Joiner jerry = new Joiner("jerry", grumpy);

        //jerry遇到了不安分的一次睡眠
        grumpy.interrupt();

        //特殊情况：假如jerry开始梦游——睡眠线程将继续完成，jerry起来走动——提前结束在床上躺着
        jerry.interrupt();

    }
}
